﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SmartSpace.UI.Silverlight.Themes.Fashtion.Utils
{
    public class MainPanelUtil : ISlViewContainerObserver
    {
        private System.Collections.Generic.Dictionary<Type, RadioButton> _elements;

        public MainPanelUtil()
        {
            _elements = new System.Collections.Generic.Dictionary<Type, RadioButton>();
        }

        public void Register(Type type, RadioButton element)
        {
            _elements.Add(type, element);
        }

        public void Update(SlViewContainer container)
        {
            foreach (Type item in _elements.Keys)
            {
                if (container.CurrentView.GetType() == item)
                {
                    _elements[item].IsChecked = true;
                }
            }
        }
    }
}
